package com.hotel.mapper;

import com.hotel.pojo.Room;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface RoomMapper {
    /**
     * room查询框
     * @return
     */
    @Select("select count(1) from room")
    Long getTotal();

    /**
     * 分页查询
     * @param start
     * @param size
     * @param query
     * @return
     */
    List<Room> findRoomListByPage(@Param("start") int start,
                                  @Param("size")int size,
                                  @Param("query")String query);

    @Select("select room_type from orders where room_type=#{roomType}")
    String getWithout();

    @Update("update room set status=#{status} where room_id=#{roomId}")
    void updateStatus();
}
